
<template>

    <div class="labor-container">
        <div class="ibox-title">
            <h1 class="center">人力资源月报汇总</h1>
        </div>
        <div class="searchMe">

            <span>选择月份</span>
            <el-date-picker v-model="startDate" 
                type="month" 
                placeholder="开始日期" 
                format='yyyy-MM' 
                value-format='yyyy-MM' 
                @change='handleStartDate' 
                >
  
            </el-date-picker>
            <el-button slot="append" type="primary" @click="initData">查询</el-button>
        </div>
        <div class="btnArea">
            <a class="btn" :href="downloadUrl">
                <i class="fa fa-external-link"></i>&nbsp;导出
            </a> 
        </div>

        <table class="table table-bordered">
            <tbody>
                <!-- <tr>
                    <td colspan="6" width="100%" ><h2 class="title">人员基本情况汇总表</h2>   </td>
                </tr> -->
                <tr>
                    <td class="cell">序&nbsp;号</td>
                    <td class="cell" colspan="2">类&nbsp;别</td>
                    <td class="cell" colspan="2">项&nbsp;目</td>
                    <td class="cell">人&nbsp;数</td>
                </tr>
                <tr>
                    <td >1</td>
                    <td colspan="2" >人&nbsp;数</td>
                    <td colspan="2" >月末人数</td>
                    <td>{{tableData.rs}}</td>
                </tr>
                <tr>
                    <td width>2</td>
                    <td rowspan="2" colspan="2" >性别结构</td>
                    <td colspan="2" >男</td>
                    <td>{{tableData.man}}</td>
                </tr>
                <tr>
                    <td >3</td>
                    <td colspan="2">女</td>
                    <td>{{tableData.woman}}</td>
                </tr>
                <tr>
                    <td width>4</td>
                    <td rowspan="7" colspan="2">年龄结构</td>
                    <td colspan="2">25岁及以下</td>
                    <td>{{tableData.agetype1}}</td>
                </tr>
                <tr>
                    <td >5</td>
                    <td colspan="2">26-30岁</td>
                    <td>{{tableData.agetype2}}</td>
                </tr>
                <tr>
                    <td >6</td>
                    <td colspan="2">31-35岁</td>
                    <td>{{tableData.agetype3}}</td>
                </tr>
                <tr>
                    <td >7</td>
                     <td colspan="2">36-40岁</td>
                    <td>{{tableData.agetype4}}</td>
                </tr>                
                <tr>
                    <td >8</td>
                    <td colspan="2">41-45岁</td>
                    <td>{{tableData.agetype5}}</td>
                </tr>                
                <tr>
                    <td >9</td>
                    <td colspan="2">46-50岁</td>
                    <td>{{tableData.agetype6}}</td>
                </tr>                
                <tr>
                    <td >10</td>
                    <td colspan="2">51岁及以上</td>
                    <td>{{tableData.agetype7}}</td>
                </tr>                
  
                <tr>
                    <td width>11</td>
                    <td rowspan="5" colspan="2">学历结构</td>
                    <td colspan="2">硕士及以上</td>
                    <td>{{tableData.ssys}}</td>
                </tr>
                
                <tr>
                    <td >12</td>
                    <td colspan="2">本科</td>
                    <td>{{tableData.bk}}</td>
                </tr>
                <tr>
                    <td >13</td>
                    <td colspan="2">大专</td>
                    <td>{{tableData.dz}}</td>
                </tr>
                <tr>
                    <td >14</td>
                    <td colspan="2">中专</td>
                    <td>{{tableData.zdzk}}</td>
                </tr>
                <tr>
                    <td >15</td>
                    <td colspan="2">高中及以下</td>
                    <td>{{tableData.gzjyx}}</td>
                </tr>


                <tr>
                    <td width>16</td>
                    <td rowspan="3" colspan="2">职称结构</td>
                    <td colspan="2">高级职称</td>
                    <td>{{tableData.gjzc}}</td>
                </tr>
                <tr>
                    <td >17</td>
                    <td colspan="2">中级职称</td>
                    <td>{{tableData.zjzc}}</td>
                </tr>
                <tr>
                    <td >18</td>
                    <td colspan="2">初级职称</td>
                    <td>{{tableData.cjzc}}</td>
                </tr>

                <tr>
                    <td >19</td>
                    <td rowspan="7" colspan="2">专业结构</td>
                    <td colspan="2">市场发展类</td>
                    <td>{{tableData.scfz}}</td>
                </tr>
                <tr>
                    <td >20</td>
                    <td colspan="2">投资发展类</td>
                    <td>{{tableData.tzfz}}</td>
                </tr>
                <tr>
                    <td >21</td>
                    <td colspan="2">营销品牌类</td>
                    <td>{{tableData.yxpp}}</td>
                </tr>
                <tr>
                    <td >22</td>
                    <td colspan="2">产品设计类</td>
                    <td>{{tableData.cpsj}}</td>
                </tr>
                <tr>
                    <td >23</td>
                    <td colspan="2">工程管理类</td>
                    <td>{{tableData.gcgl}}</td>
                </tr>
                <tr>
                    <td >24</td>
                    <td colspan="2">职能支撑类</td>
                    <td>{{tableData.znzc}}</td>
                </tr>
                <tr>
                    <td >25</td>
                    <td colspan="2">经营管理类</td>
                    <td>{{tableData.jygl}}</td>
                </tr>

                <tr>
                    <td width>26</td>
                    <td rowspan="8" colspan="2">职级结构</td>
                    <td colspan="2">总经理级</td>
                    <td>{{tableData.zjl}}</td>
                </tr>
                <tr>
                    <td >27</td>
                    <td colspan="2">副总经理级</td>
                    <td>{{tableData.fzjl}}</td>
                </tr>
                <tr>
                    <td >28</td>
                    <td colspan="2">总经理助理级</td>
                    <td>{{tableData.zjlzl}}</td>
                </tr>
                <tr>
                    <td >29</td>
                    <td colspan="2">部门经理级</td>
                    <td>{{tableData.bmjl}}</td>
                </tr>
                <tr>
                    <td >30</td>
                    <td colspan="2">部门副经理级</td>
                    <td>{{tableData.bmfjl}}</td>
                </tr>
                <tr>
                    <td >31</td>
                    <td colspan="2">部门经理助理级</td>
                    <td>{{tableData.bmjlzl}}</td>
                </tr>
                <tr>
                    <td >32</td>
                    <td colspan="2">主任师级</td>
                    <td>{{tableData.zr}}</td>
                </tr>
                <tr>
                    <td >33</td>
                    <td colspan="2">副主任师级</td>
                    <td>{{tableData.fzr}}</td>
                </tr>                
            </tbody>
        </table>

    </div>



</template>
<script>
import Vue from 'vue'
import {
	DatePicker,
	Message,
	Button
} from 'element-ui'
Vue.use(DatePicker)
Vue.use(Button)
export default {
	name: 'resume',
	data () {
		return {
			totaldate: '',
			startDate: '',
			tableData: {},
			sexList: [],
			perCountList: [],
			jobCountList: [],
			eduCountList: [],
			ageList: [],
		}
	},
	created: function () {

	},
	computed: {
		downloadUrl: function () {
			return this.Axios.baseURI + this.URL.lastMonthCountExport.url + '?token=' + localStorage.getItem('token') + '&totaldate=' + this.totaldate
		},
	},
	props: {

	},
	filters: {

	},

	methods: {
		initData: function () {

			var params = {

				totaldate: this.totaldate
			}
			this.Axios.Post(this.URL.queryLastMonthCountList.url, params)
				.then(res => {
					this.tableData = res.data.datas
					// this.tableData.sexList && (this.sexList = this.tableData.sexList)
					// this.tableData.perCountList && (this.perCountList = this.tableData.perCountList)
					// this.tableData.jobCountList && (this.jobCountList = this.tableData.jobCountList)
					// this.tableData.eduCountList && (this.eduCountList = this.tableData.eduCountList)
					// this.tableData.ageList && (this.ageList = this.tableData.ageList)


				})
		},
		handleStartDate (val) {
			this.totaldate = val
		},
	},
	mounted: function () {
		var dateTime = new Date()
		var strTime = dateTime.getFullYear() + '-' + (dateTime.getMonth() + 1 > 9 ? dateTime.getMonth() + 1 : '0' + (dateTime.getMonth() + 1))
		this.totaldate = this.startDate = strTime
		this.initData()
	}


}
</script>


<style scoped>
.labor-container .searchMe {
  width: 100%;
  margin-bottom: 15px;
  height: 60px;
  line-height: 60px;
  padding-right: 12px;
  text-align: left;
  margin-top: 15px;
}

.labor-container .searchMe span {
  margin: auto 5px;
}

.labor-container .searchMe button {
  margin: auto 5px;
}

.labor-container .btnArea .btn {
  height: 28px;
  line-height: 28px;
  text-align: center;
  color: #fff;
  display: inline-block;
  background-color: #13ce66;
  border-radius: 5px;
  padding: 5px;
  min-width: 60px;
}
.labor-container .btnArea {
  line-height: 60px;
  height: 60px;
}
.labor-container .ibox-title {
  background-color: #fff;
  border-color: #e7eaec;
  -o-border-image: none;
  border-image: none;
  color: inherit;
  border-bottom: 1px solid #e7eaec;
  color: #6c6a6c;
  padding: 15px 15px 15px;
  min-height: 48px;
}
.labor-container .table-head {
  font-size: 24px;
  text-align: center;
  margin: 20px 0px 20px 0px;
}
.labor-container .center {
  font-weight: 600;
  text-align: center;
  font-size: 20px;
  color: #333;
}
.labor-container .title {
  color: #6c6a6c;
  font-weight: 600;
}
.labor-container .table-head .btn-download {
  display: inline-block;
  margin-bottom: 0;
  font-weight: normal;
  line-height: 1.42857143;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  -ms-touch-action: manipulation;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 3px;
  color: #fff;
  background-color: #5bc0de;
  border-color: #46b8da;
}

.labor-container {
  width: 98%;
  margin: auto;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #fff;
}
.labor-container .form-photo {
  vertical-align: middle;
}
.labor-container .table tbody tr td {
  text-align: center;
  vertical-align: middle;
  font-size: 14px;
  font-family: 宋体;
  padding: 2px 5px 2px 5px;
  height: 40px;
}
.labor-container .table-bordered {
  border: 1px solid #ebeef5;
}
.labor-container .table {
  width: 100%;
  max-width: 100%;
  margin-top: 0;
}
.labor-container .table-bordered td {
  border: 1px solid #ebeef5;
}
.labor-container .table-bordered td.cell {
  color: #909399;
  font-weight: 600;
  background-color: #eef1f6;
}
.labor-container .table .label-bold {
  font-weight: bold;
}
.labor-container .table .align-right {
  text-align: right;
  padding-right: 30px;
}
.labor-container .table p {
  line-height: 30px;
  margin: 0 0 10px;
}

.labor-container .table tbody tr td {
  text-align: center;
  vertical-align: middle;
  font-family: 宋体;
  word-break: break-all;
}
.labor-container .table .align-left {
  text-align: left;
}
.labor-container .table > thead > tr > th,
.table > tbody > tr > th,
.labor-container .table > tfoot > tr > th,
.table > thead > tr > td,
.labor-container .table > tbody > tr > td,
.labor-container .table > tfoot > tr > td {
  border-top: 1px solid #ebeef5;
}
</style>
<style>
.labor-container .submit-item {
  padding-bottom: 20px;
  .el-button {
    position: absolute;
    top: -20px;
    left: 20%;
    transform: scale(1.1) translateX(-70%);
  }
}
.labor-container .loadUpload .el-upload-list {
  display: none;
}
.el-upload__tip {
  display: none;
}
.labor-container .el-button--small {
  font-size: 14px;
  vertical-align: top;
}

.labor-container .el-upload__input {
  display: none;
}

.labor-container a.downloadTable {
  display: inline-block;
  padding: 0 15px;
  height: 30px;
  line-height: 30px;
  font-size: 14px;
  vertical-align: bottom;
  float: right;
  background-color: #18a689;
  color: #fff;
  border-radius: 4px;
  margin-right: 8px;
}

html body {
  background: #fff !important;
}
</style>
<style>
.labor-container .table {
  overflow: auto;
}
</style>

